#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const double INF = 1e20;

int A, B, C, D;
double dp[14][14][14][14][5][5];
double f(int a, int b, int c, int d, int x, int y) {
  double& v = dp[a][b][c][d][x][y];
  if (v >= 0.0) return v;
  int as = a + (x == 0) + (y == 0);
  int bs = b + (x == 1) + (y == 1);
  int cs = c + (x == 2) + (y == 2);
  int ds = d + (x == 3) + (y == 3);
  if (as >= A && bs >= B && cs >= C && ds >= D) return v = 0;

  int sum = a + b + c + d + (x != 4) + (y != 4);
  sum = 54 - sum;
  if (sum <= 0) return v = INF;

  v = 1;
  if (a < 13) v += (13.0 - a) / sum * f(a + 1, b, c, d, x, y);
  if (b < 13) v += (13.0 - b) / sum * f(a, b + 1, c, d, x, y);
  if (c < 13) v += (13.0 - c) / sum * f(a, b, c + 1, d, x, y);
  if (d < 13) v += (13.0 - d) / sum * f(a, b, c, d + 1, x, y);
  if (x == 4) {
    double t = INF;
    rep(i, 0, 3) t = min(t, f(a, b, c, d, i, y));
    v += 1.0 / sum * t;
  }
  if (y == 4) {
    double t = INF;
    rep(i, 0, 3) t = min(t, f(a, b, c, d, x, i));
    v += 1.0 / sum * t;
  }
  return v;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> A >> B >> C >> D;
  memset(dp, -1, sizeof(dp));
  double t = f(0, 0, 0, 0, 4, 4);
  if (t > INF / 2) t = -1;
  cout << fixed << setprecision(3) << t;
  return 0;
}